<%--
  Created by IntelliJ IDEA.
  User: dream
  Date: 14-4-4
  Time: 下午11:14
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="../header.jsp"%>
<html>
<head>
    <title></title>
</head>
<body>
<div class="easyui-panel form_container" data-options="fit:true,border:false">
    <form id="perUser_form" class="input_form">
        <table class="input_table">
            <input type="hidden" name="id" value="${perUser.id}"/>
            <tr class="tr_dark">
                <td class="td_lable">所属部门：</td>
                <td class="td_input">
                    <input id="perDeptId" name="perDept.id" value="${perUser.perDept.id}" class="easyui-combotree"
                           data-options="url:'${ctx}/perDept/tree.do',required:true">
                </td>
            </tr>
            <tr class="tr_light">
                <td class="td_lable">登陆名：</td>
                <td class="td_input"><input type="text" name="username" value="${perUser.username}"></td>
            </tr>
        </table>
        <div style="text-align:right;padding:10px">
            <a href="javascript:void(0)" class="easyui-linkbutton save_button" id="perUser_save_button">提交</a>
            <a href="javascript:void(0)" class="easyui-linkbutton reset_button" id="perUser_reset_button">重置</a>
        </div>
    </form>
</div>
<script>
    var formObj = $('#perUser_form');
    $(function () {
        var conditions = {
            username: {required: true}
        };
        $.initFormConditions(formObj, conditions);
    });
    $('#perUser_save_button').click(function () {
        var isValid = formObj.form('validate');
        if (!isValid)
            return false;
        $(this).attr('disabled', 'disabled');
        $.simpleAjax(formObj, '${ctx}/perUser/save.do', {tableId: 'perUser_table'});
    });

    $('#perUser_reset_button').click(function () {
        formObj.reset();
    });

</script>
</body>
</html>